package com.example.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
@RestController
public class Login {
    @RequestMapping(value = "/login")
    @ResponseBody
    public HashMap<String,Object> login(String username, String password){
        HashMap<String,Object> res = new HashMap<>();
        int succ = 200;
        if(username!=null && password!=null &&
                username.equals("ylc") && password.equals("123")){
            res.put("msg","登录成功");
        }else{
            res.put("msg","登录失败");
        }
        res.put("succ",succ);
        return res;
    }
}
